No comments on this, which may be good or not.
I just got a new idea myself. What if I copy the data from all the columns in the photos, people and keywords tables into a new column in the captions table (excluding words/phrases already present in the caption column) and use both columns for this kind of general search? That way the query could be heavily simplified, much more flexible and hopefully faster:
Code:
SELECT various_columns_from_table_"photos"_and_some_columns_from_table_"people"
FROM captions
LEFT JOIN photos
ON captions.id = photos.captionid
LEFT JOIN people
ON photos.photografph_id = people.id
WHERE MATCH(caption,newColumn) AGAINST('blah blah blah' IN BOOLEAN MODE)
Well, I guess there's only one way to find out ... But it's also nice to be supervised by the more experienced coders who are able to spot obvious mistakes.
Bookmarks